package de.dhbw.horb.inf2013.vierFarbenProblem.view.java2D;

import java.awt.Color;
import java.awt.Graphics2D;

/**
 * The Class Square.
 */
public class Square {

	/** The x. */
	private int x;

	/** The y. */
	private int y;

	/** The color. */
	private Color color;

	/** The width. */
	private int width;

	/**
	 * Instantiates a new square.
	 * 
	 * @param x
	 *            the x
	 * @param y
	 *            the y
	 * @param width
	 *            the width
	 */
	public Square(int x, int y, int width) {
		this.width = width;
		this.x = x;
		this.y = y;

	}

	/**
	 * Sets the color variable.
	 * 
	 * @param color
	 *            the new color variable
	 */
	public void setColorVariable(Color color) {
		this.color = color;
	}

	/**
	 * Paint.
	 * 
	 * @param g
	 *            the g
	 */
	public void paint(Graphics2D g) {
		g.setColor(color);
		g.fillRect(x, y, width, width);
		g.setColor(Color.white);
		g.drawRect(x, y, width, width);
	}

}
